package shapewar.net.client;

import java.util.Iterator;
import java.util.Map.Entry;
import java.util.TreeMap;

import shapewar.engine.presenter.Presenter;
import shapewar.net.seriz.CreateInfo;

public class Room {
	private TreeMap<Integer,User> set = new TreeMap<Integer,User>();
	
	private Presenter pst;

	public int id = -1;
	
	public Room(Presenter pst){
		this.pst = pst;
	}
	
	public void createUser(int id){
		if(!set.containsKey(id))
			set.put(id, new User(pst));
	}
	
	public User getUserById(int id){
		return set.get(id);
	}
	
	public void exitById(int id){
		set.remove(id);
	}
	
	public Iterator<Entry<Integer, User>> getList(){
		return set.entrySet().iterator();
	}
}
